const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.ObjectId;

const Schemas = {
  Word: new Schema({
    id: ObjectId,
    title: String,
    hard: { type: Number, default: 3 },  // 1-5表示难易程度 1非常简单，2简单，3适中，4困难，5非常困难
    applyAge: { type: Number, default: 0 }, // 适用年龄段 0全部，1年轻人，2中老年人
    type: String, // 类别
    tag: String, // 标签
    isIdiom: { type: Number, default: 0 }, // 是否是成语，0非成语，1成语
  }),
  Player: new Schema({
    id: ObjectId,
    openid: String,
    nickname: String,
    avatar: String,
    lastScore: { type: Number, default: 0 },
    bestScore: { type: Number, default: 0 }
  })
}

module.exports = Schemas